<include file="Common/header" />
<title>统计图</title>
<script type="text/javascript" src="__PUBLIC__/h-ui/lib/echarts.min.js"></script>
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 数据分析
    <span class="c-gray en">&gt;</span> 租期与房租租凭分析
    <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>
<div class="pd-20">
    <div id="myChart" style="height:400px; width: 400px; float: left;"></div>
    <div id="myChart2" style="height:400px; width: 500px; float: left; padding-left: 100px;"></div><br />
	<div style="margin-top: 450px; margin-left: 100px;">
		<h3>{$content}</h3>
	</div>
</div>
<script>
    $(document).ready(function(){
        //加载图表  
        var myChart = echarts.init(document.getElementById("myChart"));  
        myChart.setOption({
            title : {
                text: '在租客人租期比例图',
                subtext: '',
                x:'center'
            },
            tooltip : {
                trigger: 'item',
            },
            series : [
                {
                    //name: '访问来源',
                    type: 'pie',
                    selectedMode: 'single',
                    radius : '55%',
                    center: ['50%', '60%'],
                    label: {
                        normal: {
                            position: 'inner'
                        }
                    },
                    data: [
						{value: {$count1}, name:'租期3个月内,{$count1},<?php echo round($count1/$mtotal, 2)*100; ?>%'},
						{value: {$count2}, name:'租期6个月内,{$count2},<?php echo round($count2/$mtotal, 2)*100; ?>%'},
						{value: {$count3}, name:'租期9个月内,{$count3},<?php echo round($count3/$mtotal, 2)*100; ?>%'},
						{value: {$count4}, name:'租期大于9个月,{$count4},<?php echo round($count4/$mtotal, 2)*100; ?>%'},
					],
                    itemStyle: {
                        emphasis: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        });

        //第二个统计图
        var myChart2 = echarts.init(document.getElementById("myChart2"));  
        myChart2.setOption({
            title : {
                text: '各房型出租率分析',
                subtext: '',
            },
            tooltip : {
                trigger: 'axis',
            },
            legend: {
                data:['长租类型房间数','出租数']
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis : [
                {
                    type : 'category',
                    data : ['D1户型','D2户型','D3户型','D4户型','D5户型'],
                    axisTick: {
                        alignWithLabel: true
                    }
                }
            ],
            yAxis : [
                {
                    type : 'value'
                }
            ],
            series : [
                {
                    name:'长租类型房间数',
                    type:'bar',
                    data: {$houseArr}
                },
                {
                    name:'出租数',
                    type:'bar',
                    data: {$memberArr}
                },
            ]
        });
    });
</script>